/*
 * Alberto De Pena
 * Applied Algorithms
 * barcode.cpp
 */
#include <fstream>
#include <string>
#include <queue>
#include <cctype>
using namespace std;


void main()
{
	ifstream fin( "barcode.in" );
	ofstream fout( "barcode.out" );

	char zero[] = {'n','n','w','w','n'};
	char one[] = {'w','n','n','n','w'};
	char two[] = {'n','w','n','n','w'};
	char three[] = {'w','w','n','n','n'};
	char four[] = {'n','n','w','n','w'};
	char five[] = {'w','n','w','n','n'};
	char six[] = {'n','w','w','n','n'};
	char seven[] = {'n','n','n','w','w'};
	char eight[] = {'w','n','n','w','n'};
	char nine[] = {'n','w','n','w','n'};

	string num;
	queue <char> barcode;
	char n, m;

	fin >> num;
	while( num != "0" )
	{
		fout << "NnNn";
		if( num.length() % 2 == 1 )
			num = "0" + num;
		for( int i = 0; i < num.length(); i++ )
			barcode.push( num[i] );

		while( !barcode.empty() )
		{
			n = barcode.front();
			barcode.pop();
			m = barcode.front();
			barcode.pop();

			for( int i = 0; i < 5; i++ )
			{
				switch (n)
				{
					case '0':
						fout << (char)toupper( zero[i] );
						break;
					case '1':
						fout << (char)toupper( one[i] );
						break;
					case '2':
						fout << (char)toupper( two[i] );
						break;
					case '3':
						fout << (char)toupper( three[i] );
						break;
					case '4':
						fout << (char)toupper( four[i] );
						break;
					case '5':
						fout << (char)toupper( five[i] );
						break;
					case '6':
						fout << (char)toupper( six[i] );
						break;
					case '7':
						fout << (char)toupper( seven[i] );
						break;
					case '8':
						fout << (char)toupper( eight[i] );
						break;
					case '9':
						fout << (char)toupper( nine[i] );
						break;
					default: 
						break;
				}
				switch (m)
				{
					case '0':
						fout << zero[i];
						break;
					case '1':
						fout << one[i];
						break;
					case '2':
						fout << two[i];
						break;
					case '3':
						fout << three[i];
						break;
					case '4':
						fout << four[i];
						break;
					case '5':
						fout << five[i];
						break;
					case '6':
						fout << six[i];
						break;
					case '7':
						fout << seven[i];
						break;
					case '8':
						fout << eight[i];
						break;
					case '9':
						fout << nine[i];
						break;
					default: 
						break;
				}

			}
		}
	
		fout << "WnN" << endl;
		fin >> num;
	}

	fin.close();
	fout.close();
}